#!/anaconda3/envs/Script/bin python3.8
# -*- coding: utf-8 -*-
# ---
# @Software: PyCharm
# @File: db_operate_log.py
# @Author: AllenFu
# @Institution: NCHU, China
# @E-mail: nchufujianjian@126.com
# @Site: 
# @Time: 11月 27, 2020
# ---
import time

from sqlalchemy import event

from app.models.log import Log


@event.listens_for(Log, "before_insert")
def log_before_insert(mapper, connection, target):
    target.create_time = int(time.time())